package com.lindroy.jetpacknotes.hilt.util

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
import javax.inject.Singleton

/**
 * @author Lin
 * @date 2023/7/28
 * @function
 */
@Module
//@InstallIn(ActivityComponent::class)
@InstallIn(SingletonComponent::class) //ApplicationComponent
class NetworkUtil {

    @Singleton
    @Provides
    fun getOkHttpClient(): OkHttpClient = OkHttpClient.Builder()
        .connectTimeout(10, TimeUnit.SECONDS)
        .build()
}